import cv2
from dataprocess import PreProcess, PostProcess
from model import ONNXModel

ppocr = ONNXModel(onnx_path="assets/ppocr.onnx")
prep = PreProcess()     # 预处理实例化
postp = PostProcess(character_dict_path='assets/plate_dict.txt')    # 后处理实例化


img = cv2.imread(r"test_img.jpeg")

imp = prep(img)             # 预处理
out = ppocr.forward(imp)    # 推理
rec_result = postp(out[0])  # 后处理

print(rec_result)
cv2.imshow("",img)
cv2.waitKey(0)

